<!--
  ~
  ~   ~ MIT License
  ~   ~
  ~   ~ Copyright (c) 2021-2022 yangrunkang
  ~   ~
  ~   ~ Author: yangrunkang
  ~   ~ Email: yangrunkang53@gmail.com
  ~   ~
  ~   ~ Permission is hereby granted, free of charge, to any person obtaining a copy
  ~   ~ of this software and associated documentation files (the "Software"), to deal
  ~   ~ in the Software without restriction, including without limitation the rights
  ~   ~ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  ~   ~ copies of the Software, and to permit persons to whom the Software is
  ~   ~ furnished to do so, subject to the following conditions:
  ~   ~
  ~   ~ The above copyright notice and this permission notice shall be included in all
  ~   ~ copies or substantial portions of the Software.
  ~   ~
  ~   ~ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  ~   ~ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  ~   ~ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  ~   ~ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  ~   ~ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  ~   ~ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  ~   ~ SOFTWARE.
  ~
  -->

<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
      th:replace="index">
<!--css-->
<link th:fragment="css" type="text/css" rel="stylesheet" th:href="${ossStatic} + @{/css/user/manage/radio.css}"/>
<!--脚本-->
<script async="async" th:fragment="js" type="text/javascript" th:src="${ossStatic} + @{/js/user/manage/radio.js}"></script>
<div th:fragment="content">
    <!--内容管理-->
    <div class="container">
        <div class="row g-2">
            <!--右列-->
            <div class="col-lg-9 mb-2">
                <div class="card border-0 rounded-3 p-2 mb-2">
                    <div th:replace="fragments/manage::nav_content(${memberIndexDto.listRadioDto.total},'radio')"></div>
                    <div class="mb-2">
                        <div class="input-group">
                            <input type="text" class="form-control" placeholder="根据标题搜索" id="searchTitle" aria-label="Recipient's username with two button addons" aria-describedby="button-addon4">
                            <button class="btn btn-outline-secondary btn-sm" id="button-addon4" type="button" onclick="manageContentSearch()">搜索</button>
                            <button class="btn btn-outline-secondary btn-sm" type="button" onclick="window.location.href = window.location.pathname">所有</button>
                        </div>
                    </div>
                    <div>
                        <!--文章列表-->
                        <div class="table-responsive fixed-table-body">
                            <table class="table table-hover" id="manage_radio_table">
                                <thead>
                                    <tr>
                                        <td class="fw-bold" style="width: 8%;">序号</td>
                                        <td class="fw-bold" style="width: 43%;">简介</td>
                                        <td class="fw-bold" style="width: 20%;">状态</td>
                                        <td class="fw-bold" style="width: 21%;">创建时间</td>
                                        <td class="fw-bold" style="width: 8%;">操作</td>
                                    </tr>
                                </thead>
                                <tbody>
                                    <tr th:if="!${#lists.isEmpty(memberIndexDto.listRadioDto.radioEnhanceList)}" th:each="radioEnhance,ite : ${memberIndexDto.listRadioDto.radioEnhanceList}" >
                                        <td>
                                            <span th:text="${ite.count}"></span>
                                        </td>
                                        <td>
                                            <a class="cv-link up-text-overflow" th:href="'/r/'+${radioEnhance.radio.radioId}" th:text="${radioEnhance.radio.radioIntro}"></a>
                                        </td>
                                        <td>
                                            <span class="badge bg-gradient rounded-3 fw-normal bg-success" th:if="${radioEnhance.radio.status.name()} == 'NORMAL'">正常</span>
                                            <span class="badge bg-gradient rounded-3 fw-normal bg-warning text-dark" th:if="${radioEnhance.radio.status.name()} == 'HIDE'">隐藏</span>
                                            <span class="badge bg-gradient rounded-3 fw-normal bg-danger" th:if="${radioEnhance.radio.status.name()} == 'DELETED'">删除</span>
                                        </td>
                                        <td th:text="${radioEnhance.createDate}">创建时间</td>
                                        <td>
                                            <div class="btn-group rounded-3 bg-gradient" role="group" aria-label="Second group">
                                                <button type="button" class="btn rounded-3 bg-gradient btn-outline-dark btn-sm dropdown-toggle" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                                                    操作
                                                </button>
                                                <div class="dropdown-menu dropdown-menu-right border-0 shadow-lg">
                                                    <a class="cv-link dropdown-item small" th:onclick="deleteRadio([[${radioEnhance.radio.radioId}]])"><span th:include="fragments/icon::shanchu"></span>删除</a>
                                                </div>
                                            </div>
                                        </td>
                                    </tr>
                                </tbody>
                            </table>
                        </div>
                        <div th:if="${#lists.isEmpty(memberIndexDto.listRadioDto.radioEnhanceList)}" th:include="fragments/index::empty_content"></div>
                        <div th:replace="fragments/page::page(${memberIndexDto.listRadioDto.pageDtoList})"></div>
                    </div>
                </div>
            </div>
            <!--左列-用户信息-->
            <div class="col-lg-3">
                <div th:include="fragments/index::user_index_left"></div>
            </div>
        </div>
    </div>
</div>
</html>
